<?php
// +----------------------------------------------------------------------
// | SL 2018.8.17
// +----------------------------------------------------------------------
// | Copyright (c) 2018~2018 http://sl.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: zq <1040657944@qq.com>
// +----------------------------------------------------------------------

namespace app\common\model;


use think\Model;

class ForumImgModel extends Model
{
    // 确定链接表名
    protected $name = 'forum_img';
    //开启时间戳写入
    protected $autoWriteTimestamp = true;

    /**
     * 插入新的图片
     */
    public function insertImg($data)
    {
        if( !empty($data['url']) && !empty($data['name']) && $this->allowField(true)->save($data) ){
            return fmsg(0,'','添加成功');
        }else{
            return fmsg(1,'','添加失败');
        }
    }
}